{config_load file='site.conf' section='ad_edit'}
{include file='header.tpl'}
{literal}
 <SCRIPT LANGUAGE="JavaScript">
 <!--	
  $(document).ready(function()
	{		
		$("#myForm").validate({
			rules: {
				ad_name: "required",
				core_link: {
					url: true
				}
			},
			messages: {
				ad_name: "広告名は必須です",
				core_link: {
					url: "正しくURLを入力してください。"
				}
			}
		});
	}
	);
 		   
	function doBack()
	{
		location.href="ad_index.php";
	}
 //-->
 </SCRIPT>
{/literal}


<div id="bg">
	<div id="page">
		<div id="content">
		{if $msg ne ""}<div class="errorMsg">{$msg}</div>{/if}
			<div class="post">
				<h2 class="title">広告編集</h2>
				<div class="entry">
				<form id="myForm" name="myForm" action="{$SCRIPT_NAME}" method="post" >
				<input type="hidden" name="actionType" id="actionType" value="update"/>
				<input type="hidden" name="adspace_id" id="adspace_id" value="{$formvars.adspace_id|escape}"/>
				
				<table width="600" id="tb_form">
					<tr>
				    <th width="150" >広告ID</th>
				    <td width="450" >{$rslt.adspace_id}</td>
				  </tr>
				  <tr>
				    <th >広告名<span class="required">(必須)</span></th>
				    <td ><input name="ad_name" type="text" id="ad_name" size="50" maxlength="200" value="{$rslt.ad_name|escape}"></td>
				  </tr>
				  <tr>
				    <th>広告タイプ</th>
				    <td>{html_options name=type options=$adTypeList selected=$rslt.type}</td>
				  </tr>
				  <tr>
				    <th>コース変更広告</th>
				    <td>{html_options name=type_c options=$cTypeList selected=$rslt.type_c}</td>
				  </tr>
				  <tr>
				    <th>アダルト広告フラグ</th>
				    <td>{html_options name=adult_ok options=$adultOkList selected=$rslt.adult_ok}</td>
				  </tr>
				  <tr>
				    <th>公開フラグ</th>
				    <td>
					{html_options name=open_flag options=$openFlagList selected=$rslt.open_flag}
					</td>
				  </tr>
				   <tr>
				    <th>広告内容</th>
				    <td>
					<textarea name="tag_contents" id="tag_contents" cols="60" rows="6" >{$rslt.tag_contents|escape}</textarea>			
					</td>
					</tr>
				   <tr>
					<th>広告リンク</th>
					<td>
					<input name="core_link" type="text" id="core_link" size="50" maxlength="200" value="{$rslt.core_link|escape}">			
					</td>
				  </tr>

				  <tr>
				    <th width="150" >&nbsp;</th>
				    <td width="450" >       
					<input type="submit" value="更新" class="submitButton">
				    <input type="reset"  value="リセット" class="submitButton">
					<input type="button"  value="戻る" OnClick="doBack();" class="submitButton">
					</td>
				  </tr>
				</table>
				<br>
				</form>				
			 	 </div>
			</div>
		</div>
		<!-- end #content -->
		<!-- end #sidebar -->
		<div style="clear: both; height: 20px;">&nbsp;</div>
	</div>
	<!-- end #page -->
</div>
{include file='footer.tpl'}


</body>
</html>
